﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Org.Eurekaa.DNJ.Settings;
using Org.Eurekaa.DNJ.UI.Common;
using Org.Eurekaa.DNJ.Common;

namespace Org.Eurekaa.DNJ.UI.DNJSettings
{
    [Serializable()]
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class DNJDialogSettings : GenericSettingsObject
    {
        [Description("When autoOpen is true the dialog will open automatically when dialog is called. If false it will stay hidden until .dialog(\"open\") is called on it.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool AutoOpen
        {
            get { return Get<bool>("autoOpen"); }
            set { this["autoOpen"] = value; }
        }

        [Description("When true, the bgiframe plugin will be used, to fix the issue in IE6 where select boxes show on top of other elements, regardless of zIndex.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool BGIframe
        {
            get { return Get<bool>("bgiframe"); }
            set { this["bgiframe"] = value; }
        }

        [Description("Specifies which buttons should be displayed on the dialog. The property key is the text of the button. The value is the callback function for when the button is clicked. The context of the callback is the dialog element; if you need access to the button, it is available as the target of the event object.")]
        [DefaultValue("Not Implemented yet"), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public String buttons
        {
            get { return "Not Implemented yet"; }
        }

        [Description("Specifies whether the dialog should close when it has focus and the user presses the esacpe (ESC) key.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool CloseOnEscape 
        {
            get { return Get<bool>("closeOnEscape"); }
            set { this["closeOnEscape"] = value; }
        }

        [Description("Specifies the text for the close button.")]
        [DefaultValue("Close"), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public String CloseText
        {
            get { return Get<String>("closeText"); }
            set { this["closeText"] = value; }
        }

        [Description("The specified class name(s) will be added to the dialog, for additional theming.")]
        [DefaultValue(""), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public String dialogClass
        {
            get { return Get<String>("dialogClass"); }
            set { this["dialogClass"] = value; }
        }

        [Description("If set to true, the dialog will be draggable will be draggable by the titlebar.")]
        [DefaultValue(true), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Draggable
        {
            get { return Get<bool>("draggable"); }
            set { this["draggable"] = value; }
        }

        [Description("The effect to be used when the dialog is closed.")]
        [DefaultValue(EnmJQueryEffect.none), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public EnmJQueryEffect Hide
        {
            get { return Get<EnmJQueryEffect>("hide"); }
            set { this["hide"] = value; }
        }

        [Description("If set to true, the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Modal
        {
            get { return Get<bool>("modal"); }
            set { this["modal"] = value; }
        }

        [Description("Specifies where the dialog should be displayed. Possible values\n1) a single string representing position within viewport: 'center', 'left', 'right', 'top', 'bottom'.\n2) an array containing an x,y coordinate pair in pixel offset from left, top corner of viewport (e.g. [350,100])\n3) an array containing x,y position string values (e.g. ['right','top'] for top right corner).")]
        [DefaultValue("center"), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public String Position
        {
            get { return Get<String>("position"); }
            set { this["position"] = value; }
        }

        [Description("If set to true, the dialog will be resizeable.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Resizable
        {
            get { return Get<bool>("resizable"); }
            set { this["resizable"] = value; }
        }

        [Description("The effect to be used when the dialog is opened.")]
        [DefaultValue(EnmJQueryEffect.none), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public EnmJQueryEffect Show
        {
            get { return Get<EnmJQueryEffect>("show"); }
            set { this["show"] = value; }
        }

        [Description("Specifies whether the dialog will stack on top of other dialogs. This will cause the dialog to move to the front of other dialogs when it gains focus.")]
        [DefaultValue(true), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool Stack
        {
            get { return Get<bool>("stack"); }
            set { this["stack"] = value; }
        }

        [Description("Specifies the title of the dialog. The title can also be specified by the title attribute on the dialog source element.")]
        [DefaultValue(""), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public String Title
        {
            get { return Get<String>("title"); }
            set { this["title"] = value; }
        }

        [Description("The starting z-index for the dialog.")]
        [DefaultValue(1000), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public int zIndex
        {
            get { return Get<int>("zIndex"); }
            set { this["zIndex"] = value; }
        }

    }
}
